package com.bootdo.api.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@SuppressWarnings("serial")
public class HttpClientClassMap {
	private static Map<String, InterfaceBean> classMap = new HashMap<String, InterfaceBean>() {
	};

	public static InterfaceBean getInterfaceBean(String interfaceName) {
		if (classMap.isEmpty())
			init();

		return classMap.get(interfaceName);
	}

	private static void init() {
		List<InterfaceBean> list = new ArrayList<>();
		/*//获得反馈进度
		list.add(new InterfaceBean(GetFeedback.class, GetFeedbackReq.class));
		//保存反馈
		list.add(new InterfaceBean(SaveFeedback.class, SaveFeedbackReq.class));
		//获得反馈详情
		list.add(new InterfaceBean(GetFeedbackDetail.class, GetFeedbackDetailReq.class));
		//获得消息通知
		list.add(new InterfaceBean(GetMessage.class, MessageReq.class));
		//获得新闻
		list.add(new InterfaceBean(GetNews.class, NewsReq.class));
		//验证码登录
		list.add(new InterfaceBean(CodeLogin.class, CodeLoginReq.class));
		//发送短信
		list.add(new InterfaceBean(SendLoginCode.class, SendLoginCodeReq.class));
		//设置支付密码
		list.add(new InterfaceBean(SetPayPassword.class, SetPayPasswordReq.class));
		//支付密码校验
		list.add(new InterfaceBean(CheckPayPassword.class, CheckPayPasswordReq.class));
		//是否有未读消息
		list.add(new InterfaceBean(CheckUnreadMessage.class, CheckUnreadMessageReq.class));
		//验证用户是否登录
		list.add(new InterfaceBean(CheckUserLogin.class, CheckUserLoginReq.class));
		//发送消息通知
		list.add(new InterfaceBean(SendMessage.class, SendMessageReq.class));
		//实名认证
		list.add(new InterfaceBean(RealName.class, RealNameReq.class));
		//查询实名认证结果
		list.add(new InterfaceBean(QueryRealNameResult.class, QueryRealNameResultReq.class));
		//验证用户信息是否正确，用户状态是否正常
		//list.add(new InterfaceBean(CheckUserInfo.class, CheckUserInfoReq.class));
		//充值
		list.add(new InterfaceBean(Recharge.class, RechargeReq.class));
		//卡状态查询
		list.add(new InterfaceBean(QueryCardStatus.class, QueryCardStatusReq.class));
		//卡状态查询
		list.add(new InterfaceBean(PayLimit.class, PayLimitReq.class));
		//版本管理
		list.add(new InterfaceBean(LatestVersion.class, LatestVersionReq.class));
		//验证是否存在该手机号的公务员用户
		list.add(new InterfaceBean(CheckCivilServantByPhone.class, CheckCivilServantByPhoneReq.class));
		//完成实名认证（上传证件照）
		list.add(new InterfaceBean(CompleteRealName.class, CompleteRealNameReq.class));
		//修改有无自行车业务
		list.add(new InterfaceBean(UpdateBicycleBusiness.class, UpdateBicycleBusinessReq.class));
		//查询共享汽车认证状态
		list.add(new InterfaceBean(QuerySharedCarAuth.class, QuerySharedCarAuthReq.class));
		//上传驾驶证照片
		list.add(new InterfaceBean(UploadDriverLicense.class, UploadDriverLicenseReq.class));
		//获得用户信息（共享汽车）
		list.add(new InterfaceBean(GetUserInfoForShareCar.class, GetUserInfoForShareCarReq.class));
		//更新认证状态
		list.add(new InterfaceBean(UpdateAuthStatus.class, UpdateAuthStatusReq.class));
		//根据手机号获得用户信息
		list.add(new InterfaceBean(GetUserInfoByPhone.class,GetUserInfoByPhoneReq.class));
		*//**通知金通来获取用户信息*//*
		list.add(new InterfaceBean(NoticeShareCar.class,NoticeShareCarReq.class));*/
		for (InterfaceBean cur : list) {
			String[] arr = cur.getClazz().getName().split("\\.");
			String key = arr[arr.length - 1];

			classMap.put(key.substring(0, 1).toLowerCase() + key.substring(1), cur);
		}
	}
}